<template>
    <div class="accept-container">
        <iframe id="show-iframe" src="http://192.168.0.93:8080/report/page/plan/marketingPlan.html" width="1200" height="300" frameborder="0" scrolling="auto"></iframe>
    </div>
</template>

<script>
    export default {
        name: 'marketingPlan',
        data () {
            return {}
        },
        mounted(){
            const oIframe = document.getElementById('show-iframe');
            const deviceWidth = document.documentElement.clientWidth;
            const deviceHeight = document.documentElement.clientHeight;
            oIframe.style.width =( deviceWidth-250) + 'px';
            oIframe.style.height = (deviceHeight - 74) + 'px';
        },
        methods:{}
    }
</script>
<style scoped></style>


<!--<template>
    <div id="plan">
        <el-table ref="filterTable" :data="dataList.slice((currentPage-1)*pagesize,currentPage*pagesize)" :highlight-current-row="true" stripe border class="table-index" :height="tableHeight" style="width: 100%;" :header-cell-style="getRowClass">
            <el-table-column fixed type="index" label="*" sortable min-width="40"></el-table-column>
            <el-table-column prop="goods_model" label="商品批号" sortable min-width="140"></el-table-column>
            <el-table-column prop="customer_msg" label="客户名称" sortable min-width="300"></el-table-column>
            <el-table-column prop="goods_count" label="商品计划数量" sortable min-width="140"></el-table-column>
            <el-table-column prop="goods_unit_price" label="商品计划单价" sortable min-width="140"></el-table-column>
            <el-table-column prop="goods_total_price" label="商品计划总价" sortable min-width="140"></el-table-column>
            <el-table-column prop="plan_arrived_time" label="计划发货时间" :formatter="formatTimestampToDate" sortable min-width="150"></el-table-column>
            <el-table-column prop="plan_receivables_time" label="计划收款时间" :formatter="formatTimestampToDate" sortable min-width="150"></el-table-column>
        </el-table>
        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                       :current-page="currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100]" :page-size="pagesize"
                       layout="total, sizes, prev, pager, next, jumper" :total="dataList.length"></el-pagination>
    </div>
</template>

<script>
    export default {
        name: "marketingPlan",
        data() {
            let token = sessionStorage.getItem("tokenId");
            let menuId = sessionStorage.getItem('menuId');
            return {
                tokenId: token,
                menuId: menuId,
                currentPage: 1,
                pagesize: 10,
                tableHeight: document.documentElement.clientHeight - 140,
                input5:'',
                dataList: [],
            };
        },
        created() {
            this.getData();
        },
        methods: {
            getData() {
                let _this = this;
                let loading = this.$loading({
                    target: document.querySelector(".wrapper > .content-box"),
                    lock: true,
                    text: '正在努力加载中...',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.8)'
                });

                console.log( '/api/adscm/hcplan/hcPlanSale/getAllSalePlan?tokenId=' + _this.tokenId )

                this.$http({
                    url: '/api/adscm/hcplan/hcPlanSale/getAllSalePlan?tokenId=' + _this.tokenId,
                    method: 'post',
                    headers: {'X-Requested-With': 'XMLHttpRequest'},
                }).then(function (res) {
                    if (res.data.statusCode == 200) {
                        _this.dataList = res.data.content;
                        loading.close();
                    } else {
                        _this.$message.error(res.data.desc);
                        loading.close();
                    }
                }).catch(function (catchres) {
                    _this.$message.error("加载失败！请重新加载...");
                    loading.close();
                })
            },
            handleSizeChange: function (size) {
                this.pagesize = size;
            },
            handleCurrentChange: function (currentPage) {
                this.currentPage = currentPage;
            },
            formatTimestampToDate:function(row, column, cellValue, index) {
                return cellValue ? this.timestampToTime(cellValue).substr(0,10) : '';
            },
            timestampToTime(timestamp) {
                if (timestamp) {
                    let date = new Date(timestamp);
                    let Y = date.getFullYear() + '-';
                    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
                    let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + " ";
                    let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ":";
                    let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ":";
                    let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
                    return timestamp ? Y + M + D + h + m + s : '';
                } else {
                    return '';
                }
            },
        }
    }
</script>
<style scoped></style>-->
